﻿using UnityEngine;
using System.Collections;

public class PasueMenu : MonoBehaviour {

	public GameObject pausedText;
	public GameObject tapToResume;
	public GameObject screenFade;

	private Color fadeCol = new Color (0, 0, 0, 0.5f);
	public void Activate()
	{
		
		MenueAni.MoveTo(pausedText, new Vector3(0, 1, 0), 0.4f, 0.0f);
		MenueAni.MoveTo(tapToResume, new Vector3(0, -1, 0), 0.4f, 0.0f);
		// dim the screen
		MenueAni.FadeTo(screenFade, fadeCol, 0.3f, 0.0f);
		// pause the music
		SoundManager.PauseMusic(0.5f);
	}

	void OnResume()
	{
		if (GameManager.Game.IsPaused)
		{
			MenueAni.MoveTo (pausedText, new Vector3(-12, 1, 0), 0.3f, 0.0f);
			MenueAni.MoveTo (tapToResume, new Vector3(12, -1, 0), 0.3f, 0.0f);

			MenueAni.FadeTo (screenFade, Color.clear, 0.3f, 0.1f);
			SoundManager.UnpauseMusic ();
			GameManager.Game.IsPaused = false;
		}
	}
}
